import React from 'react';
import {Link, Outlet} from 'react-router-dom';

export default function News() {
	const [arrs] = React.useState([
		{id: '001', title: '代码', content: '小吴会写代码'},
		{id: '002', title: '篮球', content: '小吴会打篮球'},
		{id: '003', title: '跳', content: '小吴会跳鸡你太美'},
	]);

	return (
		<div>
			<ul>
				{arrs.map(item => {
					return (
						<li key={item.id}>
							<Link
								to="details"
								state={{
									id: item.id,
									title: item.title,
									content: item.content,
								}}>
								{item.title}
							</Link>
						</li>
					);
				})}
			</ul>
			<Outlet></Outlet>
		</div>
	);
}
